<?php
	$child_ul = isset($child_ul) ? $child_ul : false;
	
	$parent = !empty($parent) ? $parent : false;
	if(!isset($route)){
		$url = '/'.$this->request->params['controller'] . '/' . $this->request->params['action'] . "/" . implode("/", $this->request->params['pass']);
		$route = Router::parse($url);
	}
?>
<? if(is_a($menu, 'SimpleXMLElement')): ?>
<ul<? if(!$child_ul): ?> id="menu"<? endif; ?>>
	<? foreach($menu->item as $item): ?>
		<?= $this->element('menu_item', array('route'=>$route, 'item'=>$item, 'child_ul'=>$child_ul, "parent"=>$parent))?>
	<? endforeach; ?>
</ul>
<? else: ?>
<p>Greška pri učitavanju Meni-ja.</p>
<? endif; ?>